﻿'use strict';

var app = app || {}; // establish application global namespace

app.CRM_CLIENT = "isha";
app.CRM_SERVER = 'http://localhost:8888';//'https://ishacrmserverdev.appspot.com';
app.CLIENT_ID = '220866004543.apps.googleusercontent.com';

angular.module('app', ['ngRoute', 'ngCookies', 'angular-growl', 'ui.bootstrap'])
  .config(['$routeProvider', function ($routeProvider) {
    // Routing
    $routeProvider.when('/', { templateUrl: 'templates/home.html', controller: 'HomeCtrl' });
    $routeProvider.when('/login', { templateUrl: 'templates/login.html', controller: 'LoginCtrl' });
    $routeProvider.when('/search', { templateUrl: 'templates/search.html', controller: 'SearchCtrl' });
    $routeProvider.when('/detailedInfo/:memberId', { templateUrl: 'templates/detailedInfo.html', controller: 'DetailedInfoCtrl' });
    $routeProvider.otherwise({ redirectTo: '/' });
  }])

  .config(['growlProvider', function(growlProvider) {
    growlProvider.globalTimeToLive({success: 2000, error: 5000, warning: 5000, info: 2000});
    growlProvider.globalPosition('top-center');
    growlProvider.globalInlineMessages(true);
  }])

  .constant('server', app.CRM_SERVER)

  ;

function init() {
    angular.bootstrap(document, ['app']);
}
